package com.care.doctor.server.service.impl;

import com.care.common.core.domain.Result;
import com.care.doctor.common.domain.DTOHospital;
import com.care.doctor.common.req.ListReq;
import com.care.doctor.server.mapper.HospitalMapper;
import com.care.doctor.server.service.HospitalService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 靳家振
 * @Date: 2024/3/22 19:35
 * @Description:
 **/

@Service
public class HospitalServiceImpl implements HospitalService {
    @Autowired
    private HospitalMapper hospitalMapper;
    @Override
    public Result<PageInfo<DTOHospital>> findHospital(ListReq req) {
        PageHelper.startPage (req.getPageNum (),req.getPageSize ());
        List<DTOHospital> list = hospitalMapper.findHospital(req);
        PageInfo<DTOHospital> pageInfo = new PageInfo<> (list);
        return Result.success (pageInfo);
    }
}
